package com.zjw.yyyy2021.mmdd0928;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * <p>TODO</p>
 *
 * @author 郑大仙丶
 * @version V1.0.0
 * @date 2021/9/28 22:06
 */
public class MMdd0928 {

    public ArrayList<Integer> GetLeastNumbers_Solution(int [] input, int k) {
        ArrayList<Integer> result = new ArrayList<>();
        if(k == 0 || input == null || input.length == 0){
            return result;
        }
        Arrays.sort(input);
        for(int i = 0; i < k;i++){
            result.add(input[i]);
        }
        return result;

    }
}
